import request from '@/utils/request'

// 查询上次选中电子秤
export const getElecSelected = async () =>{
	return request({
		url: '/project/electronic-scale-manage/getUsedScale',
		'method': 'GET'
	})
}

// 查询电子秤
export const getWeight = async () =>{
	return request({
		url: '/project/electronic-scale-manage/onlineList',
		'method': 'GET'
	})
}

// 获取更新重量
export const updateMaWeight = async (data) => {
	return request({
		url: '/project/electronic-scale-manage/weight',
		'method': 'POST',
		'data': data
	})
}

// 保存
export const updateWeight = async (data) => {
	return request({
		url: '/project/internal-code/weight',
		'method': 'POST',
		'data': data
	})
}

// 保存选中电子秤
export const savaElecSelected = async (data) => {
	return request({
		url: '/project/electronic-scale-manage/updateUsedScale',
		'method': 'POST',
		'data': data
	})
}

// 查询电子秤通讯状态
export const getElecStatus = async (data) => {
	return request({
		url: '/project/electronic-scale-manage/check',
		'method': 'POST',
		'data': data
	})
}

// 获取当前用户选择的电子秤
export const getCurrentUserElec = async (data) => {
	return request({
		url: '/project/electronic-scale-manage/getUsedScale',
		'method': 'GET',
		'data': data
	})
}